package com.longge;

/**
 * @创建人 xinglongge
 * @创建时间 2021/11/18
 * @描述
 */
public class FindKthPositive {

    public int findKthPositive(int[] arr, int k) {

        int i = 0, n = 0;
        while (k != 0 && i < arr.length) {
            n++;
            if (n == arr[i]) {
                i++;
            } else {
                k--;
                if (k == 0) return n;
            }
        }
        return n + k;

    }


}
